Auto merge of #5430 - matklad:bring-old-features-back, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 28 Apr 2018 18:02:36 +0000 (18:02 +0000)
committerbors <bors@rust-lang.org>
Sat, 28 Apr 2018 18:02:36 +0000 (18:02 +0000)
commit122fd5be5201913d42e219e132d6569493583bca
treecf2f4c41de61dea2bfc534869c98ca4b0a10fe97
parent07d022dc70e419c81f1273a42d8103f8be80f0bb
parentd369f97c19924e025a827cc2c28f0e8630511f7e
Auto merge of #5430 - matklad:bring-old-features-back, r=alexcrichton

Revert "Enable new behavior of `--feature`"

This reverts commit 038eec5cb3bd25a0855b0be6ad2aeba5391c6c6e.

As discussed at https://github.com/rust-lang/cargo/issues/5364, the new behavior unfortunately causes real-life breakage, so we have to revert it.

This is kinda sad, this is a part of the larger issue with feature selection, which, at the moment, has a behavior which I would classify (loosely speaking) as unsound:

* `cargo build -p foo` and `cargo build -p foo -p bar` might produce different artifacts for `foo` ([repro](https://github.com/matklad/workspace-vs-feaures))
* `cargo build -p foo` might produce different artifacts, depending on cwd ([repro](https://github.com/matklad/features-cwd))

The new feature behavior specifically addressed the second point.

It is unclear what we could do with this... One option, instead of flatly erroring out, as the revreted commit does, is to print a warning, but change the set of activated features. It will still be a breaking change, but it at least has  a chance of working by accident.

r? @alexcrichton